-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(autoware_path_generator): function to smooth the path #227
base: main
Are you sure you want to change the base?
feat(autoware_path_generator): function to smooth the path #227
Conversation
Description: This commit is kind of feature porting from `autoware.universe` as follows * Import `PathWithLaneId DefaultFixedGoalPlanner::modifyPathForSmoothGoalConnection` from the following `autoware.universe` code https://github.com/autowarefoundation/autoware.universe/blob/a0816b7e3e35fbe822fefbb9c9a8132365608b49/planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/default_fixed_goal_planner.cpp#L74-L104 * Also import all related functions from the `autoware.universe` side Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #227 +/- ##
==========================================
- Coverage 78.75% 8.26% -70.49%
==========================================
Files 11 122 +111
Lines 193 10196 +10003
Branches 73 1255 +1182
==========================================
+ Hits 152 843 +691
- Misses 11 9219 +9208
- Partials 30 134 +104
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
const double seg_dist = | ||
autoware::motion_utils::calcSignedArcLength(input.points, seg_idx, seg_idx + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just calc_distance2d
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this informative comment. I also guessed this is just a calculation for 2-dimensional distance between two points. If this is not my misunderstanding, the calcSignedArcLength()
function calculates the total path length by summing up the 2D distances between consecutive points, as shown in the following code:
Ref. to code:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we need to ensure which method should we use.
planning/autoware_path_generator/include/autoware/path_generator/utils.hpp
Outdated
Show resolved
Hide resolved
* @param goal_lanelet Goal lanelet. | ||
* @return True if the goal lanelet is found, false otherwise | ||
*/ | ||
bool get_goal_lanelet(const PlannerData & planner_data, lanelet::ConstLanelet * goal_lanelet); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better not to use raw pointer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by this commit 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm not fixed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, sorry for my bad! Let me fix soon!
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com>
* Enhance error handlings * Remove unused variables * Simplify the code * Improve readability a little bit Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
…sasakisasaki/autoware.core into feat-embed-smooth-path-as-alpha-quality Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
* This fix is for the following PR: autowarefoundation/autoware.core#227 Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
* This comment is wrote because of my misunderstanding Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Fixing error in some CI checks. |
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
* The goal position is generally separate from the path points Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
* CI (especially unit tests) fails due to this sanity check * As this is out of scope for this PR, we will fix the bug where the start and end are reversed in another PR Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
* We should start from the simple one * Then we can add the necessary optimization later Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
@@ -12,3 +12,5 @@ | |||
search_distance: 30.0 | |||
resampling_interval: 1.0 | |||
angle_threshold_deg: 15.0 | |||
refine_goal_search_radius_range: 10.0 # [m] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the default value in behavior_path_planner is
refine_goal_search_radius_range: 7.5
do you have any reason chagagin from that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your feedback! Let me fix this to 7.5, as there is no specific reason. The reason was experimental use on the testing phase.
planning/autoware_path_generator/include/autoware/path_generator/common_structs.hpp
Outdated
Show resolved
Hide resolved
// Replace the goal point with the refined goal | ||
filtered_path.points.back().point.pose = goal; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is only the goal being replaced now?
Are the other points in the refine_goal_search_radius_range range be retained?
If so, I wonder if the goal and one of its previous points will have a larger deviation, causing a distortion of the path.
The original algorithm generates a smooth path by smoothly connecting between refine_goal_search_radius_range
. After the points deletion, spline interpolation is executed in a later stage of the process to smooth them out.
please check original logic.
https://autowarefoundation.github.io/autoware.universe/main/planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/#fixed_goal_planner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry I dit not give enough infomartion. 🙇
After the deletion, the splines are executed in a later stage of the process to smooth them out.
so behavior path logic is
- set refined goal and remove points whitiin radius in
fixed_goal_planner
side - spline interpolation is in
behaivor_path_planner
side
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
( this comment is by just reading code. I have not checked actual behavior in psim. I'm building now... )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the detailed and kind lecture! It seems my misunderstanding is derived from as follows. Now I should be understanding the point. Let me fix this too!
- The minimum distance range is assumed not from the current position (front of the path points), but from the goal
I changed PR title route -> path. route is like missoin level output |
reopened #227 (comment) |
|
||
if (distance_to_goal < planner_data_.path_generator_parameters.refine_goal_search_radius_range) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now this is a limitation:
cannnot generate paths to goals further than refine_goal_search_radius_range
from the centerline.
I want to resolve this limitation in a later PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh, that is good observation. I did not notice such the wider road case.
In this PR, let us keep this specification the that limitation. Maybe we can use the width of the whole road to optimize the search radius range automatically.
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
* The type of returned value and arguments were wrong Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
…or/common_structs.hpp Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com>
…sasakisasaki/autoware.core into feat-embed-smooth-path-as-alpha-quality Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
…sasakisasaki/autoware.core into feat-embed-smooth-path-as-alpha-quality Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
* autowarefoundation#227 (comment) Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
…sasakisasaki/autoware.core into feat-embed-smooth-path-as-alpha-quality Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
path_up_to_just_before_pre_goal.points.push_back(prepare_pre_goal(goal, lanes)); | ||
|
||
// Replace the goal point with the refined goal | ||
path_up_to_just_before_pre_goal.points.back().point.pose = goal; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, this is a bug. Let me fix soon.
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Description
This is kind of feature porting from
autoware.universe
as followsPathWithLaneId DefaultFixedGoalPlanner::modifyPathForSmoothGoalConnection
from theautoware.universe
side codeautoware.universe
sideQuality of Code
I'm improving the code quality so this PR is ready for review.The unit tests for the added feature has not been added yet.The refactoring plan is mentioned in this issue.
Perhaps we can work on the refactoring with a few PRs. Including this idea for refactoring, please feel free to share your idea for the improvement of code quality. Thank you!
How was this PR tested?
vcs import
at around 18:00 JST on 26th Feb. 2025behavior_planning_launch_xml.txt
tier4_planning_component_launch_xml.txt
path_generator_param_yaml.txt
Screencast_psim.webm
Status of Additional Tests
(ADDED) It seems the tests on the evaluator shows a failed scenario link to failed one. I'm now investigating the issue.
Notes for reviewers
Please do not enable auto merge as this PR needed to be merged with this launch side PR at the same time.
Please feel free to provide all the needed tests for merging this PR. I'm really happy for performing the tests 👍
Effects on system behavior
Needed to be investigated during the testing process.